---
root: "/v5.1"
title: "/="
keywords: ""
layout: "default"
description: "Swift documentation for '/='"
---

<div class="intro-declaration"><code class="language-swift">func /=(lhs:rhs:)(lhs: inout Int, rhs: Int)</code></div><div class="discussion comment"><p>Divides the first value by the second and stores the quotient in the
left-hand-side variable.
</p>
<p>For integer types, any remainder of the division is discarded.</p>
<pre><code class="language-swift">var x = 21
x /= 5
// x == 4
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func /=(lhs:rhs:)(lhs: inout Int16, rhs: Int16)</code></div><div class="discussion comment"><p>Divides the first value by the second and stores the quotient in the
left-hand-side variable.
</p>
<p>For integer types, any remainder of the division is discarded.</p>
<pre><code class="language-swift">var x = 21
x /= 5
// x == 4
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func /=(lhs:rhs:)(lhs: inout Int32, rhs: Int32)</code></div><div class="discussion comment"><p>Divides the first value by the second and stores the quotient in the
left-hand-side variable.
</p>
<p>For integer types, any remainder of the division is discarded.</p>
<pre><code class="language-swift">var x = 21
x /= 5
// x == 4
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func /=(lhs:rhs:)(lhs: inout Int64, rhs: Int64)</code></div><div class="discussion comment"><p>Divides the first value by the second and stores the quotient in the
left-hand-side variable.
</p>
<p>For integer types, any remainder of the division is discarded.</p>
<pre><code class="language-swift">var x = 21
x /= 5
// x == 4
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func /=(lhs:rhs:)(lhs: inout Int8, rhs: Int8)</code></div><div class="discussion comment"><p>Divides the first value by the second and stores the quotient in the
left-hand-side variable.
</p>
<p>For integer types, any remainder of the division is discarded.</p>
<pre><code class="language-swift">var x = 21
x /= 5
// x == 4
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func /=(lhs:rhs:)(lhs: inout UInt, rhs: UInt)</code></div><div class="discussion comment"><p>Divides the first value by the second and stores the quotient in the
left-hand-side variable.
</p>
<p>For integer types, any remainder of the division is discarded.</p>
<pre><code class="language-swift">var x = 21
x /= 5
// x == 4
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func /=(lhs:rhs:)(lhs: inout UInt16, rhs: UInt16)</code></div><div class="discussion comment"><p>Divides the first value by the second and stores the quotient in the
left-hand-side variable.
</p>
<p>For integer types, any remainder of the division is discarded.</p>
<pre><code class="language-swift">var x = 21
x /= 5
// x == 4
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func /=(lhs:rhs:)(lhs: inout UInt32, rhs: UInt32)</code></div><div class="discussion comment"><p>Divides the first value by the second and stores the quotient in the
left-hand-side variable.
</p>
<p>For integer types, any remainder of the division is discarded.</p>
<pre><code class="language-swift">var x = 21
x /= 5
// x == 4
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func /=(lhs:rhs:)(lhs: inout UInt64, rhs: UInt64)</code></div><div class="discussion comment"><p>Divides the first value by the second and stores the quotient in the
left-hand-side variable.
</p>
<p>For integer types, any remainder of the division is discarded.</p>
<pre><code class="language-swift">var x = 21
x /= 5
// x == 4
</code></pre>
</div><div class="intro-declaration"><code class="language-swift">func /=(lhs:rhs:)(lhs: inout UInt8, rhs: UInt8)</code></div><div class="discussion comment"><p>Divides the first value by the second and stores the quotient in the
left-hand-side variable.
</p>
<p>For integer types, any remainder of the division is discarded.</p>
<pre><code class="language-swift">var x = 21
x /= 5
// x == 4
</code></pre>
</div>